##
# This script set linux specific flags (GNU GCC)
#
##
import os
import SCons.Util

Import('env')

print("Reading linux configuration script")

env['CCFLAGS'] = SCons.Util.CLVar(os.environ.get('CFLAGS', ""))
env.AppendUnique(CPPDEFINES=['WITH_POSIX', '__linux__'])
env.AppendUnique(CFLAGS=['-std=gnu99'])
env.AppendUnique(CCFLAGS=['-Wextra', '-fPIC'])
env.AppendUnique(LIBS=['dl', 'pthread'])

env.AppendUnique(
    CCFLAGS=['-D__TIZEN__', '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE'])
env.ParseConfig("pkg-config dlog --cflags --libs")
if env.get('OIC_SUPPORT_TIZEN_TRACE') == 'True':
    env.ParseConfig("pkg-config ttrace --cflags --libs")
    env.AppendUnique(CPPDEFINES=['OIC_SUPPORT_TIZEN_TRACE'])
# Set arch flags : It will be handled by Tizen build system.
